package com.wx.spring.utils;

import com.wx.spring.constant.BasicDataType;

/**
 * @author wx
 * @Description: 验证工具类
 * @date 2019/1/4 000418:23
 */
public class ValidationUtils {

    private ValidationUtils(){
        throw new RuntimeException("工具类禁止实例化");
    }
     
    /**
     * @description: 判断是不是基本数据类型
     * @author: wx
     * @date: 2019/1/4 0004
     * @param typeName
     * @return: boolean
     */
    public static  boolean isBasicType(String typeName){
        if (BasicDataType.STRING.equals(typeName)) {
            return true;
        } else if (BasicDataType.INTEGER.equals(typeName)) {
            return true;
        } else if (BasicDataType.FLOAT.equals(typeName)) {
            return true;
        } else if (BasicDataType.DOUBLE.equals(typeName)) {
            return true;
        } else if (BasicDataType.LONG.equals(typeName)) {
            return true;
        } else if (BasicDataType.SHORT.equals(typeName)) {
            return true;
        } else if (BasicDataType.BYTE.equals(typeName)) {
            return true;
        } else if (BasicDataType.BOOLEAN.equals(typeName)) {
            return true;
        }
        return false;
    }
}
